const Mock = require("mockjs");
var Random = Mock.Random
const List = [];
const count = 100;

// const image_uri =
//   "https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3";

// for (let i = 0; i < count; i++) {
//   List.push(
//     Mock.mock({
//       id: "@increment",
//       timestamp: +Mock.Random.date("T"),
//       author: "@first",
//       reviewer: "@first",
//       title: "@title(5, 10)",
//       content_short: "mock data",
//       forecast: "@float(0, 100, 2, 2)",
//       importance: "@integer(1, 3)",
//       "type|1": ["CN", "US", "JP", "EU"],
//       "status|1": ["published", "draft"],
//       display_time: "@datetime",
//       comment_disabled: true,
//       pageviews: "@integer(300, 5000)",
//       image_uri:"@image('200x200', '#FF6600')",
//       platforms: ["a-platform"],
//     })
//   );
// }

module.exports = [
  {
    url: "/getContent",
    type: "get",
    response: (config) => {
      const { id } = config.query;
      const data = Mock.mock({
        id,
        timestamp: +Mock.Random.date("T"),
        author: "@first",
        reviewer: "@first",
        title: "@title(5, 10)",
        content_short: "mock data",
        forecast: "@float(0, 100, 2, 2)",
        importance: "@integer(1, 3)",
        "type|1": ["CN", "US", "JP", "EU"],
        "status|1": ["published", "draft"],
        display_time: "@datetime",
        comment_disabled: true,
        pageviews: "@integer(300, 5000)",
        image_uri:"@image('200x200', '@color')",
        head_img: "@image('36x36', '@color')",
        platforms: ["a-platform"],
      });
      return { 
        code: 0,
        data,
      };
    },
  },
];
